home *** CD-ROM | disk | FTP | other *** search
/ Magnum One / Magnum One (Mid-American Digital) (Disc Manufacturing).iso / d12 / c_toolbx.arc / VARSIZE.C < prev    next >
Encoding:
C/C++ Source or Header  |  1988-03-30  |  748 b   |  30 lines

  1. /*  varsize.c - compare and size functions - char[16] keys */
  2. #include   "stdio.h"
  3. #include   "btree.h"
  4. #include   "bt_macro.h"
  5.  
  6. #define KEY_SIZE    16                  /* max length of a key */
  7.  
  8. int  ndum = 20 ;                        /* length of dummy entry */
  9.  
  10. ENTRY   dume =                          /* dummy entry with high key */
  11.   {  NULLREC  ,  {  0xff , 0xff , 0xff , 0xff ,
  12.                     0xff , 0xff , 0xff , 0xff ,
  13.                     0xff , 0xff , 0xff , 0xff ,
  14.                     0xff , 0xff , 0xff , 0x0  } } ;
  15.  
  16.  
  17. int  compf(p1,p2)
  18.   ENTRY *p1 , *p2 ;
  19.   {
  20.      return( strcmp( p1->key, p2->key) ) ;
  21.   }
  22.  
  23. int  sizef(p1)
  24.   ENTRY *p1 ;
  25.   {
  26.      return( strlen(p1->key) + 1 + sizeof(RECPOS) ) ;
  27.   }
  28.  
  29.  
  30.